package com.ysx.server.controller;

import com.ysx.server.pojo.vo.CategoryVO;
import com.ysx.server.service.CategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/category")
@Slf4j
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    /**
     * 获取商品类型
     * @return
     */
    @GetMapping("/getCategory")
    public List<CategoryVO> getCategory(){
        log.info("获取商品类型");
        return categoryService.getCategory();
    }
}
